<template>
      <div id="news">
            <div class="imgbox">
                  <img src="../assets/img/news.png" alt="">
            </div>
            <news-swiper :zhong="zhong" v-if="zhong.length > 0"></news-swiper>
            <news-dong :hangye="hangye"></news-dong>
            <hangye-dong :hyData="news"></hangye-dong>
      </div>
</template>

<script>
      import NewsSwiper from "@/components/news/NewsSwiper"
      import NewsDong from "@/components/news/NewsDong"
      import HangyeDong from "@/components/news/HangyeDong"
      export default {
            components: {
                  NewsSwiper,
                  NewsDong,
                  HangyeDong
            },
            data() {
                  return {
                        newsList: {},
                        zhong: [],
                        hangye: [],
                        news: []
                  }
            },
            created () {
                  
            },
            mounted () {
                 this.getNews();
                 this.setKeyword()
            },
            methods: {
                  async getNews() {
                        let res = await this.$axios.post("/index/index/messageshow", { key: this.$key })
                        // console.log(res);
                        this.newsList = res.data.data
                        this.zhong = this.newsList.zong
                        this.news = this.newsList.xin
                        this.hangye = this.newsList.dong
                        //console.log(this.zhong);
                        
                  },
                  // 设置关键词
                  setKeyword() {
                        let kw = "支付刷脸系统招商、刷脸支付招商、智能刷脸支付招商、支付刷脸招商、手机刷脸支付招商、脸刷支付系统招商、刷脸付款招商、刷脸支付设备招商"
                        
                        document.querySelector("meta[name='keywords']").setAttribute('content', kw)
                  }
            },
      }
</script>

<style lang="scss" scoped>
#news {
      width: 100%;
      .imgbox {
            width: 100%;
            img {
                  width: 100%;
                  display: block;
            }
      }
}
</style>